<?php
/**
 * usescript component
 * @package kernel_component_resource
 */
load_lib('/sys/component');
/**
 * usescript component
 * @author pandajingjing
 * @package kernel_component_resource
 */
class resource_usescriptcomponent extends sys_component{

	/**
	 * 获取UI
	 */
	function getView(){
		$strCdnDomain=get_config('cdn_domain');
		$strCBScriptURLPre=$strCdnDomain.get_config('cb_script_url_pre','resource');
		$strSScriptURLPre=$strCdnDomain.get_config('s_script_url_pre','resource');
		$strOutScriptURLPre='http://'.get_config('static_domain');
		$arrData=$this->getDatas();
		foreach($arrData['S'] as $intIndex=>$strSScript){
			$arrData['S'][$intIndex]=$strSScriptURLPre.$strSScript;
		}
		foreach($arrData['O'] as $intIndex=>$strOScript){
			$arrData['O'][$intIndex]=str_replace('static:/',$strOutScriptURLPre,$strOScript);
		}
		foreach($arrData['CB'] as $intIndex=>$strCBScript){
			$arrData['CB'][$intIndex]=$strCBScriptURLPre.$strCBScript;
		}
		$this->setData('S',$arrData['S']);
		$this->setData('CB',$arrData['CB']);
		$this->setData('O',$arrData['O']);
		return 'usescript';
	}
}